import com.example.gensurdatviwi.application.controller.Controller;
import com.vaadin.ui.*;

/**
 * Das grundlegende Window der Applikation.
 * 
 * @author Michael Hausegger
 *
 */
public class ApplicationWindowPanel extends Panel {

	private VerticalLayout    baseLayout       =  new VerticalLayout(); 
	private TitleBarLayout    titleBar         =  new TitleBarLayout();  
	private HorizontalLayout  horlayout        =  new HorizontalLayout();	
	        
	private Controller        cont             =  null;

	private DetailsPanel      detailsPanel;

	
	/**
	 * Instanziert das Objekt mit dem uebergebenen Controller.
	 * Nimmt die notwendigen Layouteinstellungen vor.
	 * 
	 * @param cont Die Controllerklasse mit Geschaeftslogik.
	 */
	public ApplicationWindowPanel(Controller cont) {
		
		super();
				
		this.cont = cont;
								  
		baseLayout.setSizeFull();
		        		          
		baseLayout.addComponent(titleBar);
	 
		horlayout.setSpacing(true);
		baseLayout.addComponent(horlayout);
				        		
		detailsPanel = new DetailsPanel(this.cont);				
		horlayout.addComponent(detailsPanel);
						
		this.addComponent(baseLayout);
								
		detailsPanel.showWelcomeMessage();
				
	}
	
}
